#ifndef WIDGETSMANAGER_H
#define WIDGETSMANAGER_H

#include <DefineLibUiQt.h>
#include <QtCore/QObject>
#include <QtCore/QPointer>
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtCore/QMap>
#include <QtWidgets/QMainWindow>

class LIB_UI_QT_DLL WidgetsManager : public QObject
{
    Q_OBJECT
public:

    virtual ~WidgetsManager();
    static WidgetsManager* instance();

    void addWidgetToMap(const QString& str, QWidget* widgetPtr);
    QWidget* getWidgetFromMap(const QString& str);

signals:
	void signalWidgetsManagerClosed();

protected:
    virtual void closeEvent( QCloseEvent * event);
private:
    WidgetsManager(QObject *parent = 0);
    static WidgetsManager* _instance;

    QMap<QString, QWidget*> m_widgetsMap;
};

#endif // WIDGETSMANAGER_H
